#include "Thread.h"

static void *startFunction(void *data) {
	Thread* thread = (Thread*) data;
	thread->startMethod();
	return NULL;
}

Thread::Thread(){
	this->thread = 0;
}

bool Thread::start() {
	return (!pthread_create(&(this->thread), NULL, startFunction, this));
}

bool Thread::join() {
	return (!pthread_join(this->thread, NULL));
}

void Thread::exit() {
	pthread_exit(NULL);
}


Thread::~Thread(){
}



